package com.lagou.edu.wwy.demo.controller;

import com.lagou.edu.wwy.mvcframework.annotation.LagouController;
import com.lagou.edu.wwy.mvcframework.annotation.LagouRequestMapping;
import com.lagou.edu.wwy.mvcframework.annotation.Security;

@LagouController
@LagouRequestMapping("security")
@Security
public class SecurityController {
    /**
     * 只有zhangsan 能访问
     * @param username
     * @return
     */
    @LagouRequestMapping("zhangsan")
    @Security("zhangsan")
    public String zhangsan(String username){
        return username +"验证通过";
    }

    /**
     * 只有zhangsan\lisi 两个账号能访问
     * @param username
     * @return
     */
    @Security({"zhangsan","lisi"})
    @LagouRequestMapping("duoren")
    public String duoren(String username){
        return username +"验证通过(duoren)";
    }

    /**
     * 只要上传username都可以访问
     * @param username
     * @return
     */
    @LagouRequestMapping("all")
    public String all(String username){
        return username +"验证通过(all)";
    }
}
